<?php
/**
 * Created by PhpStorm.
 * User: deng
 * Date: 2015/3/6
 * Time: 21:24
 */

namespace Test\Controller;

use Think\Controller;

//vendor('Qiniu.Auth');

vendor("Qiniu.rs");
vendor("Qiniu.auth_digest");

class QiniuController extends Controller
{
    function index()
    {
        //$auth = new Auth();
        $bucket = 'phpsdk';
        $accessKey = '<YOUR_APP_ACCESS_KEY>';
        $secretKey = '<YOUR_APP_SECRET_KEY>';

        Qiniu_SetKeys($accessKey, $secretKey);
        $putPolicy = new \Qiniu_RS_PutPolicy($bucket);
        $upToken = $putPolicy->Token(null);
        print_r($upToken);
    }
}